
#ifndef _CHUNK_H_
#define _CHUNK_H_

class Chunk
{
public:
	enum SIGN
	{
		ChunkNone						= 0x0000,

		//data type------------------------------------------------------------------------------
		ChunkColorf						= 0x0010,	//Rgb (float)
		ChunkColorb						= 0x0011,	//Rgb (byte)
		ChunkColorbg					= 0x0012,	//Rgb (byte) gamma corrected
		ChunkColorfg					= 0x0013,	//Rgb (float) gamma corrected

		ChunkPercenti					= 0x0030,	//percent (int)
		ChunkPercentf					= 0x0031,	//percent (float)

		//subject--------------------------------------------------------------------------------
		Chunk3DS						= 0x4D4D,	//3DS file sign
		ChunkVersion					= 0x0002,	//3DS file version

		ChunkEditor						= 0x3D3D,	//3D mesh chunk
		ChunkMeshVersion				= 0x3D3E,	//Mesh version dword
		ChunkMeshUnit					= 0x0100,	//One unit

		ChunkMaterial					= 0xAFFF,	//Material block
		ChunkMaterialName				= 0xA000,	//Material name
		ChunkMaterialAmbient					= 0xA010,	//Ambient color
		ChunkMaterialDiffuse					= 0xA020,	//Diffuse color
		ChunkMaterialSpecular					= 0xA030,	//Specular color
		ChunkMaterialShininess					= 0xA040,	//Shininess percent
		ChunkMaterialShininessStrength			= 0xA041,	//Shininess strength percent
		ChunkMaterialTransparency				= 0xA050,	//Transparency percent
		ChunkMaterialTransparencyFalloff		= 0xA052,	//Transparency falloff percent
		ChunkMaterialReflection					= 0xA053,	//Reflection blur percent
		ChunkMaterialTextureMin					= 0xA200,	//Texture define min
		ChunkMaterialTextureMax					= 0xA34C,	//Texture define max

		ChunkMesh								= 0x4000,	//Object block

		ChunkMeshHidden							= 0x4010,	//Object hidden

		ChunkMeshMesh							= 0x4100,	//Triangular mesh
		ChunkMeshVertices						= 0x4110,	//Vertices list
		ChunkMeshFaces							= 0x4120,	//Faces description
		ChunkMeshFacesMatlist					= 0x4130,	//Faces material list
		ChunkMeshTexCoords						= 0x4140,	//Mapping coordinates list
		ChunkMeshSmoothingGroupList				= 0x4150,	//Smoothing group list
		ChunkMeshLocalCoordSystem				= 0x4160,	//Local coordinate system
		ChunkMeshColor							= 0x4165,	//Object color in editor

		ChunkFramer						= 0xB000,	//Keyframer chunk

		ChunkEnd
	};

public:
	Chunk()
	{
		_sign = 0;
		_size = 0;
		_begin = 0;
	}

	void setBegin(int begin)
	{
		_begin = begin;
	}
	void setSign(unsigned short sign)
	{
		_sign = sign;
	}
	void setSize(int size)
	{
		_size = size;
	}

	int begin() const
	{
		return _begin;
	}
	unsigned short sign() const
	{
		return _sign;
	}
	int size() const
	{
		return _size;
	}
	int end() const
	{
		return _begin + _size;
	}

private:
	int		_begin;
	unsigned short	_sign;
	int		_size;
};

#endif